package prv.behavioral.command;

import java.util.ArrayList;
import java.util.List;

/* The Invoker class */
public class Switch {
	private List<Command> history = new ArrayList<Command>();

	public Switch() {
	}

	public void storeAndExecute(Command cmd) {
		this.history.add(cmd); // optional
		cmd.execute();
	}

	public List<Command> getHistory() {
		return history;
	}
}
